<?php

namespace app\common\middleware;

use app\common\service\SiteCheckService;
use app\Request;
use Closure;

class SiteCheck
{

    public function handle(Request $request, Closure $next)
    {

        //校对当前登录的用户是否拥有这个站点的管理权限
        $site_info = (new SiteCheckService())->checkSiteAuth($request);
        $request->siteId($site_info['site_id']);
        return $next($request);
    }

}